﻿<!DOCTYPE html>
<html>
  <head>
    <title>超声测距</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <link href="resources/css/jquery-ui-themes.css" type="text/css" rel="stylesheet"/>
    <link href="resources/css/axure_rp_page.css" type="text/css" rel="stylesheet"/>
    <link href="data/styles.css" type="text/css" rel="stylesheet"/>
    <link href="files/超声测距/styles.css" type="text/css" rel="stylesheet"/>
    <script src="resources/scripts/jquery-1.7.1.min.js"></script>
    <script src="resources/scripts/jquery-ui-1.8.10.custom.min.js"></script>
    <script src="resources/scripts/prototypePre.js"></script>
    <script src="data/document.js"></script>
    <script src="resources/scripts/prototypePost.js"></script>
    <script src="files/超声测距/data.js"></script>
    <script type="text/javascript">
      $axure.utils.getTransparentGifPath = function() { return 'resources/images/transparent.gif'; };
      $axure.utils.getOtherPath = function() { return 'resources/Other.html'; };
      $axure.utils.getReloadPath = function() { return 'resources/reload.html'; };
    </script>
  </head>
  <body>
    <div id="base" class="">

      <!-- Unnamed (组 合) -->
      <div id="u1071" class="ax_default" data-left="50" data-top="118" data-width="263" data-height="119">

        <!-- Unnamed (矩形) -->
        <div id="u1072" class="ax_default box_1">
          <div id="u1072_div" class=""></div>
          <div id="u1072_text" class="text ">
            <p><span>HC-SR04</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1073" class="ax_default box_1">
          <div id="u1073_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1074" class="ax_default ellipse">
          <img id="u1074_img" class="img " src="images/超声测距/u1074.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1075" class="ax_default label">
          <div id="u1075_div" class=""></div>
          <div id="u1075_text" class="text ">
            <p><span>VCC</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1076" class="ax_default ellipse">
          <img id="u1076_img" class="img " src="images/超声测距/u1074.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1077" class="ax_default label">
          <div id="u1077_div" class=""></div>
          <div id="u1077_text" class="text ">
            <p><span>Trig</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1078" class="ax_default ellipse">
          <img id="u1078_img" class="img " src="images/超声测距/u1074.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1079" class="ax_default label">
          <div id="u1079_div" class=""></div>
          <div id="u1079_text" class="text ">
            <p><span>Echo</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1080" class="ax_default ellipse">
          <img id="u1080_img" class="img " src="images/超声测距/u1074.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1081" class="ax_default label">
          <div id="u1081_div" class=""></div>
          <div id="u1081_text" class="text ">
            <p><span>GND</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1082" class="ax_default ellipse">
          <img id="u1082_img" class="img " src="images/三色led/u705.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1083" class="ax_default ellipse">
          <img id="u1083_img" class="img " src="images/三色led/u705.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1084" class="ax_default ellipse">
          <img id="u1084_img" class="img " src="images/三色led/u705.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1085" class="ax_default ellipse">
          <img id="u1085_img" class="img " src="images/三色led/u705.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1086" class="ax_default ellipse">
          <img id="u1086_img" class="img " src="images/超声测距/u1086.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1087" class="ax_default ellipse">
          <img id="u1087_img" class="img " src="images/超声测距/u1087.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1088" class="ax_default ellipse">
          <img id="u1088_img" class="img " src="images/超声测距/u1086.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1089" class="ax_default ellipse">
          <img id="u1089_img" class="img " src="images/超声测距/u1087.png"/>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u1090" class="ax_default _文本段落">
        <div id="u1090_div" class=""></div>
        <div id="u1090_text" class="text ">
          <p><span style="font-family:'Arial Negreta', 'Arial Normal', 'Arial';font-weight:700;">Tips：</span></p><p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;"><br></span></p><p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;">超声测距的原理：</span></p><p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;"><br></span></p><p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;">模块先发送超声波，超声波遇到障碍物反射回来，被模块接收到。模块从发送超声波的那一刻开始计时，到接收到反射回来的超声波的那一刻停止计时。计算两次计时之间的时间差。根据声波的传播速度计算模块与障碍物之间的距离。</span></p><p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;"><br></span></p><p><span style="font-family:'Arial Negreta', 'Arial Normal', 'Arial';font-weight:700;">发送超声波的操作</span><span style="font-family:'Arial Normal', 'Arial';font-weight:400;">：通过程序给Trig引脚持续输出10us的高电平。此时模块会自动发出8组频率为40kHz的声波。发出声波的同时，模块将Echo针脚设置为高电平，启动计时器开始计时。</span></p><p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;"><br></span></p><p><span style="font-family:'Arial Negreta', 'Arial Normal', 'Arial';font-weight:700;">接受超声波的操作</span><span style="font-family:'Arial Normal', 'Arial';font-weight:400;">：模块接收到反射回来的超声波信号，将Echo针脚重新置为低电平，结束计时，计算两者时间差。</span></p><p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;"><br></span></p><p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;">声波在空气中的传播速度为344m/s，根据时间计算声波往返的距离。再将距离除以2得到单边的距离。</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u1091" class="ax_default _一级标题">
        <div id="u1091_div" class=""></div>
        <div id="u1091_text" class="text ">
          <p><span>所需硬件：</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u1092" class="ax_default label">
        <div id="u1092_div" class=""></div>
        <div id="u1092_text" class="text ">
          <p><span>HC-SR04超声测距模块</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u1093" class="ax_default _一级标题">
        <div id="u1093_div" class=""></div>
        <div id="u1093_text" class="text ">
          <p><span>硬件接线：</span></p>
        </div>
      </div>

      <!-- Unnamed (组 合) -->
      <div id="u1094" class="ax_default" data-left="168" data-top="662" data-width="110" data-height="281">

        <!-- Unnamed (矩形) -->
        <div id="u1095" class="ax_default box_1">
          <div id="u1095_div" class=""></div>
          <div id="u1095_text" class="text ">
            <p><span>Arduino</span></p><p><span>NANO</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1096" class="ax_default box_1">
          <div id="u1096_div" class=""></div>
          <div id="u1096_text" class="text ">
            <p><span>0</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1097" class="ax_default box_1">
          <div id="u1097_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1098" class="ax_default box_1">
          <div id="u1098_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1099" class="ax_default box_1">
          <div id="u1099_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1100" class="ax_default box_1">
          <div id="u1100_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1101" class="ax_default box_1">
          <div id="u1101_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1102" class="ax_default box_1">
          <div id="u1102_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1103" class="ax_default ellipse">
          <img id="u1103_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1104" class="ax_default box_1">
          <div id="u1104_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1105" class="ax_default label">
          <div id="u1105_div" class=""></div>
          <div id="u1105_text" class="text ">
            <p><span>VIN</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1106" class="ax_default ellipse">
          <img id="u1106_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1107" class="ax_default box_1">
          <div id="u1107_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1108" class="ax_default label">
          <div id="u1108_div" class=""></div>
          <div id="u1108_text" class="text ">
            <p><span>GND</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1109" class="ax_default ellipse">
          <img id="u1109_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1110" class="ax_default box_1">
          <div id="u1110_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1111" class="ax_default label">
          <div id="u1111_div" class=""></div>
          <div id="u1111_text" class="text ">
            <p><span>RST</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1112" class="ax_default ellipse">
          <img id="u1112_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1113" class="ax_default box_1">
          <div id="u1113_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1114" class="ax_default label">
          <div id="u1114_div" class=""></div>
          <div id="u1114_text" class="text ">
            <p><span>5V</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1115" class="ax_default ellipse">
          <img id="u1115_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1116" class="ax_default box_1">
          <div id="u1116_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1117" class="ax_default label">
          <div id="u1117_div" class=""></div>
          <div id="u1117_text" class="text ">
            <p><span>A7</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1118" class="ax_default ellipse">
          <img id="u1118_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1119" class="ax_default box_1">
          <div id="u1119_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1120" class="ax_default label">
          <div id="u1120_div" class=""></div>
          <div id="u1120_text" class="text ">
            <p><span>A6</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1121" class="ax_default ellipse">
          <img id="u1121_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1122" class="ax_default label">
          <div id="u1122_div" class=""></div>
          <div id="u1122_text" class="text ">
            <p><span>A5</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1123" class="ax_default box_1">
          <div id="u1123_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1124" class="ax_default ellipse">
          <img id="u1124_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1125" class="ax_default box_1">
          <div id="u1125_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1126" class="ax_default label">
          <div id="u1126_div" class=""></div>
          <div id="u1126_text" class="text ">
            <p><span>A4</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1127" class="ax_default ellipse">
          <img id="u1127_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1128" class="ax_default box_1">
          <div id="u1128_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1129" class="ax_default label">
          <div id="u1129_div" class=""></div>
          <div id="u1129_text" class="text ">
            <p><span>A3</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1130" class="ax_default ellipse">
          <img id="u1130_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1131" class="ax_default box_1">
          <div id="u1131_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1132" class="ax_default label">
          <div id="u1132_div" class=""></div>
          <div id="u1132_text" class="text ">
            <p><span>A2</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1133" class="ax_default ellipse">
          <img id="u1133_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1134" class="ax_default box_1">
          <div id="u1134_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1135" class="ax_default label">
          <div id="u1135_div" class=""></div>
          <div id="u1135_text" class="text ">
            <p><span>A1</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1136" class="ax_default ellipse">
          <img id="u1136_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1137" class="ax_default box_1">
          <div id="u1137_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1138" class="ax_default label">
          <div id="u1138_div" class=""></div>
          <div id="u1138_text" class="text ">
            <p><span>A0</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1139" class="ax_default ellipse">
          <img id="u1139_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1140" class="ax_default box_1">
          <div id="u1140_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1141" class="ax_default label">
          <div id="u1141_div" class=""></div>
          <div id="u1141_text" class="text ">
            <p><span>REF</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1142" class="ax_default ellipse">
          <img id="u1142_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1143" class="ax_default box_1">
          <div id="u1143_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1144" class="ax_default label">
          <div id="u1144_div" class=""></div>
          <div id="u1144_text" class="text ">
            <p><span>3V3</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1145" class="ax_default ellipse">
          <img id="u1145_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1146" class="ax_default box_1">
          <div id="u1146_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1147" class="ax_default label">
          <div id="u1147_div" class=""></div>
          <div id="u1147_text" class="text ">
            <p><span>D13</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1148" class="ax_default ellipse">
          <img id="u1148_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1149" class="ax_default box_1">
          <div id="u1149_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1150" class="ax_default ellipse">
          <img id="u1150_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1151" class="ax_default box_1">
          <div id="u1151_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1152" class="ax_default ellipse">
          <img id="u1152_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1153" class="ax_default box_1">
          <div id="u1153_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1154" class="ax_default ellipse">
          <img id="u1154_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1155" class="ax_default box_1">
          <div id="u1155_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1156" class="ax_default ellipse">
          <img id="u1156_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1157" class="ax_default box_1">
          <div id="u1157_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1158" class="ax_default ellipse">
          <img id="u1158_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1159" class="ax_default box_1">
          <div id="u1159_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1160" class="ax_default ellipse">
          <img id="u1160_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1161" class="ax_default box_1">
          <div id="u1161_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1162" class="ax_default ellipse">
          <img id="u1162_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1163" class="ax_default box_1">
          <div id="u1163_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1164" class="ax_default ellipse">
          <img id="u1164_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1165" class="ax_default box_1">
          <div id="u1165_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1166" class="ax_default ellipse">
          <img id="u1166_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1167" class="ax_default box_1">
          <div id="u1167_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1168" class="ax_default ellipse">
          <img id="u1168_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1169" class="ax_default box_1">
          <div id="u1169_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1170" class="ax_default ellipse">
          <img id="u1170_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1171" class="ax_default box_1">
          <div id="u1171_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1172" class="ax_default ellipse">
          <img id="u1172_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1173" class="ax_default box_1">
          <div id="u1173_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1174" class="ax_default ellipse">
          <img id="u1174_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1175" class="ax_default box_1">
          <div id="u1175_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1176" class="ax_default ellipse">
          <img id="u1176_img" class="img " src="images/四角开关/u87.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1177" class="ax_default box_1">
          <div id="u1177_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1178" class="ax_default label">
          <div id="u1178_div" class=""></div>
          <div id="u1178_text" class="text ">
            <p><span>TX</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1179" class="ax_default label">
          <div id="u1179_div" class=""></div>
          <div id="u1179_text" class="text ">
            <p><span>RX</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1180" class="ax_default label">
          <div id="u1180_div" class=""></div>
          <div id="u1180_text" class="text ">
            <p><span>RST</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1181" class="ax_default label">
          <div id="u1181_div" class=""></div>
          <div id="u1181_text" class="text ">
            <p><span>GND</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1182" class="ax_default label">
          <div id="u1182_div" class=""></div>
          <div id="u1182_text" class="text ">
            <p><span>D2</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1183" class="ax_default label">
          <div id="u1183_div" class=""></div>
          <div id="u1183_text" class="text ">
            <p><span>D3</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1184" class="ax_default label">
          <div id="u1184_div" class=""></div>
          <div id="u1184_text" class="text ">
            <p><span>D4</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1185" class="ax_default label">
          <div id="u1185_div" class=""></div>
          <div id="u1185_text" class="text ">
            <p><span>D5</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1186" class="ax_default label">
          <div id="u1186_div" class=""></div>
          <div id="u1186_text" class="text ">
            <p><span>D6</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1187" class="ax_default label">
          <div id="u1187_div" class=""></div>
          <div id="u1187_text" class="text ">
            <p><span>D7</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1188" class="ax_default label">
          <div id="u1188_div" class=""></div>
          <div id="u1188_text" class="text ">
            <p><span>D8</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1189" class="ax_default label">
          <div id="u1189_div" class=""></div>
          <div id="u1189_text" class="text ">
            <p><span>D9</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1190" class="ax_default label">
          <div id="u1190_div" class=""></div>
          <div id="u1190_text" class="text ">
            <p><span>D10</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1191" class="ax_default label">
          <div id="u1191_div" class=""></div>
          <div id="u1191_text" class="text ">
            <p><span>D11</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1192" class="ax_default label">
          <div id="u1192_div" class=""></div>
          <div id="u1192_text" class="text ">
            <p><span>D12</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1193" class="ax_default box_1">
          <div id="u1193_div" class=""></div>
          <div id="u1193_text" class="text ">
            <p><span>USB</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1194" class="ax_default box_1">
          <div id="u1194_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1195" class="ax_default box_1">
          <div id="u1195_div" class=""></div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1196" class="ax_default box_1">
          <div id="u1196_div" class=""></div>
        </div>
      </div>

      <!-- Unnamed (组 合) -->
      <div id="u1197" class="ax_default" data-left="93" data-top="449" data-width="263" data-height="119">

        <!-- Unnamed (矩形) -->
        <div id="u1198" class="ax_default box_1">
          <div id="u1198_div" class=""></div>
          <div id="u1198_text" class="text ">
            <p><span>HC-SR04</span></p>
          </div>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1199" class="ax_default box_1">
          <div id="u1199_div" class=""></div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1200" class="ax_default ellipse">
          <img id="u1200_img" class="img " src="images/超声测距/u1074.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1201" class="ax_default label">
          <div id="u1201_div" class=""></div>
          <div id="u1201_text" class="text ">
            <p><span>VCC</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1202" class="ax_default ellipse">
          <img id="u1202_img" class="img " src="images/超声测距/u1074.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1203" class="ax_default label">
          <div id="u1203_div" class=""></div>
          <div id="u1203_text" class="text ">
            <p><span>Trig</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1204" class="ax_default ellipse">
          <img id="u1204_img" class="img " src="images/超声测距/u1074.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1205" class="ax_default label">
          <div id="u1205_div" class=""></div>
          <div id="u1205_text" class="text ">
            <p><span>Echo</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1206" class="ax_default ellipse">
          <img id="u1206_img" class="img " src="images/超声测距/u1074.png"/>
        </div>

        <!-- Unnamed (矩形) -->
        <div id="u1207" class="ax_default label">
          <div id="u1207_div" class=""></div>
          <div id="u1207_text" class="text ">
            <p><span>GND</span></p>
          </div>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1208" class="ax_default ellipse">
          <img id="u1208_img" class="img " src="images/三色led/u705.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1209" class="ax_default ellipse">
          <img id="u1209_img" class="img " src="images/三色led/u705.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1210" class="ax_default ellipse">
          <img id="u1210_img" class="img " src="images/三色led/u705.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1211" class="ax_default ellipse">
          <img id="u1211_img" class="img " src="images/三色led/u705.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1212" class="ax_default ellipse">
          <img id="u1212_img" class="img " src="images/超声测距/u1086.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1213" class="ax_default ellipse">
          <img id="u1213_img" class="img " src="images/超声测距/u1087.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1214" class="ax_default ellipse">
          <img id="u1214_img" class="img " src="images/超声测距/u1086.png"/>
        </div>

        <!-- Unnamed (椭圆形) -->
        <div id="u1215" class="ax_default ellipse">
          <img id="u1215_img" class="img " src="images/超声测距/u1087.png"/>
        </div>
      </div>

      <!-- Unnamed (连接线) -->
      <div id="u1216" class="ax_default _连接线">
        <img id="u1216_seg0" class="img " src="images/超声测距/u1216_seg0.png" alt="u1216_seg0"/>
        <img id="u1216_seg1" class="img " src="images/超声测距/u1216_seg1.png" alt="u1216_seg1"/>
        <img id="u1216_seg2" class="img " src="images/超声测距/u1216_seg2.png" alt="u1216_seg2"/>
        <img id="u1216_seg3" class="img " src="images/超声测距/u1216_seg3.png" alt="u1216_seg3"/>
        <div id="u1216_text" class="text " style="display:none; visibility: hidden">
          <p></p>
        </div>
      </div>

      <!-- Unnamed (连接线) -->
      <div id="u1217" class="ax_default _连接线">
        <img id="u1217_seg0" class="img " src="images/超声测距/u1217_seg0.png" alt="u1217_seg0"/>
        <img id="u1217_seg1" class="img " src="images/超声测距/u1217_seg1.png" alt="u1217_seg1"/>
        <img id="u1217_seg2" class="img " src="images/超声测距/u1217_seg2.png" alt="u1217_seg2"/>
        <img id="u1217_seg3" class="img " src="images/超声测距/u1217_seg3.png" alt="u1217_seg3"/>
        <div id="u1217_text" class="text " style="display:none; visibility: hidden">
          <p></p>
        </div>
      </div>

      <!-- Unnamed (连接线) -->
      <div id="u1218" class="ax_default _连接线">
        <img id="u1218_seg0" class="img " src="images/超声测距/u1218_seg0.png" alt="u1218_seg0"/>
        <img id="u1218_seg1" class="img " src="images/超声测距/u1218_seg1.png" alt="u1218_seg1"/>
        <img id="u1218_seg2" class="img " src="images/超声测距/u1218_seg2.png" alt="u1218_seg2"/>
        <img id="u1218_seg3" class="img " src="images/超声测距/u1218_seg3.png" alt="u1218_seg3"/>
        <img id="u1218_seg4" class="img " src="images/超声测距/u1218_seg4.png" alt="u1218_seg4"/>
        <img id="u1218_seg5" class="img " src="images/超声测距/u1218_seg5.png" alt="u1218_seg5"/>
        <div id="u1218_text" class="text " style="display:none; visibility: hidden">
          <p></p>
        </div>
      </div>

      <!-- Unnamed (连接线) -->
      <div id="u1219" class="ax_default _连接线">
        <img id="u1219_seg0" class="img " src="images/超声测距/u1219_seg0.png" alt="u1219_seg0"/>
        <img id="u1219_seg1" class="img " src="images/超声测距/u1219_seg1.png" alt="u1219_seg1"/>
        <img id="u1219_seg2" class="img " src="images/超声测距/u1219_seg2.png" alt="u1219_seg2"/>
        <img id="u1219_seg3" class="img " src="images/超声测距/u1219_seg3.png" alt="u1219_seg3"/>
        <div id="u1219_text" class="text " style="display:none; visibility: hidden">
          <p></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u1220" class="ax_default _一级标题">
        <div id="u1220_div" class=""></div>
        <div id="u1220_text" class="text ">
          <p><span>示例代码：</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u1221" class="ax_default _文本段落">
        <div id="u1221_div" class=""></div>
        <div id="u1221_text" class="text ">
          <p><span>#define Trig 2 //引脚Trig 连接 D2:对应针脚号2</span></p><p><span>#define Echo 3 //引脚Echo 连接 D3:对应针脚号3</span></p><p><span><br></span></p><p><span>float dis; //计算最后的距离</span></p><p><span>float timer; //计时器</span></p><p><span><br></span></p><p><span>void setup() {</span></p><p><span>&nbsp; Serial.begin(9600);</span></p><p><span>&nbsp; pinMode(Trig, OUTPUT);</span></p><p><span>&nbsp; pinMode(Echo, INPUT);</span></p><p><span>}</span></p><p><span><br></span></p><p><span>void loop() {</span></p><p><span>&nbsp; //控制发射超声波</span></p><p><span>&nbsp; digitalWrite(Trig, LOW); </span></p><p><span>&nbsp; delayMicroseconds(2);&nbsp;&nbsp; </span></p><p><span>&nbsp; digitalWrite(Trig,HIGH); </span></p><p><span>&nbsp; delayMicroseconds(10);&nbsp; </span></p><p><span>&nbsp; digitalWrite(Trig, LOW); </span></p><p><span><br></span></p><p><span>&nbsp; //发送完声波开始计时，同时等待声波返回。</span></p><p><span>&nbsp; timer = float(pulseIn(Echo, HIGH)); </span></p><p><span>&nbsp; //Echo引脚电平为HIGH时，pulseIn函数开始计算时间</span></p><p><span>&nbsp; //当检测到返回的声波时，Echo引脚电平为LOW，pulseIn函数停止计时。</span></p><p><span>&nbsp; //声速是:340m/s = 0.034cm/μs</span></p><p><span>&nbsp; //距离：0.034*temp/2 = 0.017 * temp cm</span></p><p><span>&nbsp; </span></p><p><span>&nbsp; dis = timer * 0.017f; //把回波时间换算成cm</span></p><p><span><br></span></p><p><span>&nbsp; //打印输出测距结果</span></p><p><span>&nbsp; Serial.print(&quot;time:&quot;);</span></p><p><span>&nbsp; Serial.print(timer);</span></p><p><span>&nbsp; Serial.print(&quot;μs&quot;);</span></p><p><span>&nbsp; Serial.print(&quot; &lt;--&gt; distance:&quot;);</span></p><p><span>&nbsp; Serial.print(dis);</span></p><p><span>&nbsp; Serial.println(&quot;cm&quot;);</span></p><p><span>&nbsp; </span></p><p><span>&nbsp; delay(1000);</span></p><p><span>}</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u1222" class="ax_default _一级标题">
        <div id="u1222_div" class=""></div>
        <div id="u1222_text" class="text ">
          <p><span>运行结果：</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u1223" class="ax_default label">
        <div id="u1223_div" class=""></div>
        <div id="u1223_text" class="text ">
          <p><span>打开串口监视器查看串口输出的距离值。</span></p>
        </div>
      </div>
    </div>
  </body>
</html>
